page {
  height: 100%;
  overflow: hidden;
}
.viewport {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.search {
  padding: 20rpx 30rpx;
  background-color: #fff;
  .input {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64rpx;
    padding-left: 26rpx;
    color: #8b8b8b;
    font-size: 28rpx;
    border-radius: 32rpx;
    background-color: #f3f4f4;
  }
}
.icon-search {
  &::before {
    margin-right: 10rpx;
  }
}
/* 分类 */
.categories {
  flex: 1;
  min-height: 400rpx;
  display: flex;
}
/* 一级分类 */
.primary {
  overflow: hidden;
  width: 180rpx;
  flex: none;
  background-color: #f6f6f6;
  .item {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 96rpx;
    font-size: 26rpx;
    color: #595c63;
    position: relative;
    &::after {
      content: '';
      position: absolute;
      left: 42rpx;
      bottom: 0;
      width: 96rpx;
      border-top: 1rpx solid #e3e4e7;
    }
  }
  .active {
    background-color: #fff;
    &::before {
      content: '';
      position: absolute;
      left: 0;
      top: 0;
      width: 8rpx;
      height: 100%;
      background-color: #27ba9b;
    }
  }
}
.primary .item:last-child::after,
.primary .active::after {
  display: none;
}
/* 二级分类 */
.secondary {
  background-color: #fff;
  .carousel {
    height: 200rpx;
    margin: 0 30rpx 20rpx;
    border-radius: 4rpx;
    overflow: hidden;
  }
  .panel {
    margin: 0 30rpx 0rpx;
  }
  .title {
    height: 60rpx;
    line-height: 60rpx;
    color: #333;
    font-size: 28rpx;
    border-bottom: 1rpx solid #f7f7f8;
    .more {
      float: right;
      padding-left: 20rpx;
      font-size: 24rpx;
      color: #999;
    }
  }
  .more {
    &::after {
      font-family: 'erabbit' !important;
      content: '\e6c2';
    }
  }
  .section {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    padding: 20rpx 0;
    .goods {
      width: calc(50% - 20rpx); // 改为50%宽度，
      margin: 0rpx 20rpx 20rpx 0;
      padding-bottom: 10rpx;
       // 添加以下样式
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      &:nth-child(2n) {
        margin-right: 0;
      }
      .image {
        width: 100%; // 图片宽度改为100%适应容器
        height: 200rpx; // 增加图片高度以保持比例
      }
      .point-image {
        width: 26rpx;
        height: 26rpx;
      }
      .name {
        padding: 5rpx;
        font-size: 24rpx; // 稍微增加字体大小提高可读性
        color: #333;
      }
      .info-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 5rpx;
        width: 100%;
      }

      .exchange-btn-container {
        flex-shrink: 0;
      }

      .exchange-btn {
        font-size: 24rpx;
        padding: 6rpx 16rpx;
        background-color: #27ba9b;
        color: white;
        border-radius: 18rpx;
        line-height: 1.5;
      }
      .price {
        display: flex;
        align-items: center;
        font-size: 18rpx;
        color: #cf4444;
        flex-grow: 1;
        margin-right: 10rpx;
      }
      .number {
        font-size: 24rpx;
        margin-left: 2rpx;
      }
    }
  }
}

// 加载中遮罩样式
.loading-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-content {
  background-color: white;
  padding: 30rpx;
  border-radius: 10rpx;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.spinner {
  width: 50rpx;
  height: 50rpx;
  border: 6rpx solid #f3f3f3;
  border-top: 6rpx solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20rpx;
}

.loading-text {
  font-size: 28rpx;
  color: #333;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
